<?php use_helper('jQuery')?>

<div id="main_header" class="ui-widget-header ui-corner-all">
    <h3>Video: "<?php echo $content->getTitle() ?>"</h3>
</div>
<div id="main_content" class="ui-widget ui-widget-content ui-corner-all">
    <table>
        <?php if($sf_user->hasCredential('Editar contenido')): ?>
            <tfoot>
                <tr>
                    <td colspan="2" >
                        <?php echo jq_link_to_remote(
                                '<span class="ui-button-icon-primary ui-icon ui-icon-pencil"></span>
                                <span class="ui-button-text">Editar</span>',
                            array(
                                'update' => 'main',
                                'url' => url_for('content_edit',$content),
                                'before' => 'clearView();showLoaderMain();',
                                'complete' => 'initContentVideoFileUpload("'.url_for('content_tempfileupload',
                                                $content->getType()).'?section_id='.
                                                $content->getSectionId().'&portal_id='.$content->getSection()->getPortalId().'");'
                                                .'hideLoader();',
                                'script' => true
                            ),
                            array(
                                'class' => 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary',
                                'title' => 'Editar'
                            ))
                        ?>
                    </td>
                </tr>
            </tfoot>
        <?php endif; ?>
        <tbody>
            <tr>
                <th>Pertenece a la Sección:</th>
                <td>
                    <?php if($sf_user->hasCredential('Ver sección')): ?>
                    <?php echo jq_link_to_remote($content->getSection()->getTitle(),
                            array(
                                'update' => 'main',
                                'url'    => url_for('section_show',$content->getSection()),
                                'after'  => 'clearView();'
                            ),array('title' => 'Ir a la sección: "'.$content->getSection().'"'))?>
                    <?php else: ?>
                        <?php echo $content->getSection()->getTitle() ?>
                    <?php endif; ?>
                </td>
            </tr>
            <tr>
                <th>Autor:</th>
                <?php if($content->getAuthor()): ?>
                    <td><?php echo $content->getAuthor() ?></td>
                <?php else: ?>
                    <td>Autor no especificado.</td>
                <?php endif;?>
            </tr>
            <tr>
                <th>Imagen pequeña:</th>
                <td><img alt="<?php echo $content->getThumbSmall() ?>"
                         src="<?php echo '/uploads/portal_'.$content->getSection()->getPortalId().'/images/'.$content->getThumbSmall() ?>"/>
                </td>
            </tr>
            <tr>
                <th>Imagen grande:</th>
                <td><img alt="<?php echo $content->getThumbBig() ?>"
                         src="<?php echo '/uploads/portal_'.$content->getSection()->getPortalId().'/images/'.$content->getThumbBig() ?>"/>
                </td>
            </tr>
            <tr>
                <th>Resumen:</th>
                <td><?php echo $content->getSummary() ?></td>
            </tr>
            <tr>
                <th>Video:</th>
                <td>
                    <a class="videoplayer" href=
                        <?php echo '/uploads/portal_'.$content->getSection()->getPortalId().'/videos/'.$content->getVideo()->getFile() ?>></a>
                </td>
            </tr>
            <tr>
                <th>Publicado:</th>
                <td>
                    <?php if ($content->getPublished() == true): ?>
                        <img alt="Sí" src="/images/util/check.png">
                    <?php else: ?>
                        <img alt="No" src="/images/util/cross.png">
                    <?php endif; ?>
                </td>
            </tr>
            <tr>
                <th>Fecha de creación:</th>
                <td><?php echo $content->getCreatedAt() ?></td>
            </tr>
            <tr>
                <th><label>Ultima modificación:</label></th>
                <td><?php echo $content->getUpdatedAt() ?></td>
            </tr>
        </tbody>
    </table>
</div>